package com.jk.service.register;

import com.jk.dao.register.RegisterMapper;
import com.jk.pojo.PayAddress;
import com.jk.pojo.PayBank;
import com.jk.pojo.PayDict;
import com.jk.pojo.PayUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * &lt;pre&gt;项目名称：jk-pay
 * 类名称：
 * 创建人：李金春
 * 手机号：18839726119
 * 创建时间：${Time} ${Date}
 * 修改人：李金春
 * 修改时间：${Time} ${Date}
 * 修改备注：
 */
@Service("registerServiceImpl")
public class RegisterServiceImpl implements RegisterService {
    @Autowired
    private RegisterMapper registerMapper;

    /**根据用户输入的手机号进行查询验重*/
    @Override
    public List<PayUser> selUserPhoneByUserAccount(String useraccount) {
        return registerMapper.selUserPhoneByUserAccount(useraccount);
    }

    /**根据银行卡号查询银行卡信息*/
    @Override
    public PayBank selBankCardByBankCardId(PayBank bank) {
        return registerMapper.selBankCardByBankNum(bank);
    }

    /**页面加载查询职业*/
    @Override
    public List<PayDict> selProfession(Integer registerProfessionDictno) {
        List<PayDict> list = registerMapper.selProfession(registerProfessionDictno);
        return list;
    }

    /**页面加载查询省市县*/
    @Override
    public List<PayAddress> selSSS(PayAddress address) {
        List<PayAddress> li = new ArrayList<PayAddress>();
        if(address != null){
            if(address.getId() != null && !"".equals(address.getId())){
                li = registerMapper.selSS(address.getId());
            }else{
                li = registerMapper.selSheng();
            }
        }
        return li;
    }
}
